import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 学生入组申请单信息 */
export interface WelfareStudentApply {
          id: number; // 主键ID
          studentName?: string; // 学生姓名
          age?: number; // 年龄
          schoolName?: string; // 所在学校
          gradeClass?: string; // 年级班级
          parMobile?: string; // 家长手机号
          visionDesc: string; // 视力简述
  }

// 学生入组申请单 API
export const WelfareStudentApplyApi = {
  // 查询学生入组申请单分页
  getWelfareStudentApplyPage: async (params: any) => {
    return await request.get({ url: `/mcm/welfare-student-apply/page`, params })
  },

  // 查询学生入组申请单详情
  getWelfareStudentApply: async (id: number) => {
    return await request.get({ url: `/mcm/welfare-student-apply/get?id=` + id })
  },

  // 新增学生入组申请单
  createWelfareStudentApply: async (data: WelfareStudentApply) => {
    return await request.post({ url: `/mcm/welfare-student-apply/create`, data })
  },

  // 修改学生入组申请单
  updateWelfareStudentApply: async (data: WelfareStudentApply) => {
    return await request.put({ url: `/mcm/welfare-student-apply/update`, data })
  },

  // 删除学生入组申请单
  deleteWelfareStudentApply: async (id: number) => {
    return await request.delete({ url: `/mcm/welfare-student-apply/delete?id=` + id })
  },

  /** 批量删除学生入组申请单 */
  deleteWelfareStudentApplyList: async (ids: number[]) => {
    return await request.delete({ url: `/mcm/welfare-student-apply/delete-list?ids=${ids.join(',')}` })
  },

  // 导出学生入组申请单 Excel
  exportWelfareStudentApply: async (params) => {
    return await request.download({ url: `/mcm/welfare-student-apply/export-excel`, params })
  },
}